<div class="bus_user">
    <div class="nav">
        <div class="nav-li focus">提现管理</div>
    </div>

    <hr />

    <div class="box">
    	<h4>用户列表与提现管理
            <android:paperbutton class="small" title="刷新" event-click="{{'$Event.refresh_hash'}}">
                <android:icon type="action-autorenew" ></android:icon>
            </android:paperbutton>
        </h4>
        <div class="to-cash-config">
            <android:input label="每次提现最大金额" value="{{bus_loginer.info.data_get_cash_max_each_time||'（不限制每次申请提现最大额度）'}}" bind-input="{{'bus_loginer.info.data_get_cash_max_each_time'}}" description="单次申请提现的最大金额" event-change="{{'$Event.bus_user.update_config'}}"></android:input>
            <label>每月提现次数：<inputNumber value="{{bus_loginer.info.data_get_cash_times_each_month}}" bind-input="{{'bus_loginer.info.data_get_cash_times_each_month'}}" loop="1" min="0" event-change="{{'$Event.bus_user.update_config'}}"></inputNumber><i>{{!bus_loginer.info.data_get_cash_times_each_month?"不限制申请提现次数":""}}</i></label>
        </div>
        <div class="hr"></div>
        <table class="paper-table">
            <thead>
                <td>用户名</td>
                <td>手机号/邮箱</td>
                <td>支付宝账号</td>
                <td >已提现的金额</td>
                <td >已使用的金额</td>
                <td >可用提现额度</td>
                <td >申请提现额度</td>
                <td>操作</td>
            </thead>
            {{#each $Cache.bus.bus_user.all}}
            <tr>
                <td>{{user.info.name}}</td>
                <td>{{user.info.mobile_phone||user.info.email}}</td>
                <td>{{#if user.info.alipay}}{{user.info.alipay}}{{#else}}<i>用户未绑定</i>{{/if}}</td>
                <td>{{#Fixed money_to_cash}}</td>
                <td>{{#Fixed money_used}}</td>
                <td>{{#Fixed money}}</td>
                <td>{{#Fixed money_apply}}</td>
                <td>
                    {{#if state==$Top.config.BUS_USER_STATE.未申请兑换}}
                    <div class="info">用户并未申请兑换</div>
                    {{/if}} {{#if state==$Top.config.BUS_USER_STATE.申请兑换中}}
                    <div class="info">用户请求兑换，请将金额转到用户账上</div>
                    <button event-click="{{'$Top.$Event.bus.bus_user.商家已经打款_to_用户确认收款'}}">转账完成</button>
                    <!-- 现在默认是直接全部兑换TODO：兑换上限 -->
                    {{/if}} {{#if state==$Top.config.BUS_USER_STATE.商家已经打款}}
                    <div class="info">等待用户确认收款</div>
                    {{/if}}
                </td>
            </tr>
            {{/each}}
        </table>
    </div>
</div>
